package com.kitty.game.hunqiao.enums;

import java.util.concurrent.ThreadLocalRandom;

public enum HunQiaoColorEnum {
    BLUE("蓝色",1,(short)2136),
    PINK("粉色",2,(short)2137),
    GOLD("金色",3,(short)2138),

    ;

    HunQiaoColorEnum(String color, Integer fieldNum, short icon) {
        this.color = color;
        this.fieldNum = fieldNum;
        this.icon = icon;
    }

    /** 颜色 **/
    private String color;
    /** 属性条数 **/
    private Integer fieldNum;
    /** 图标 **/
    private short icon;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Integer getFieldNum() {
        return fieldNum;
    }

    public void setFieldNum(Integer fieldNum) {
        this.fieldNum = fieldNum;
    }

    public short getIcon() {
        return icon;
    }

    public void setIcon(short icon) {
        this.icon = icon;
    }

    /**
     * 根据等级来取颜色
     * todo 概率自己调，这里乱写的
     */
    public static HunQiaoColorEnum random(int level){
        int num = ThreadLocalRandom.current().nextInt(10)+level;
        if(num<6){
            return HunQiaoColorEnum.BLUE;
        }else if(num<9){
            return HunQiaoColorEnum.PINK;
        }else{
            return HunQiaoColorEnum.GOLD;
        }
    }
}
